<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
    <table width="100%" border="0" cellpadding="0" cellspacing="0"> 
		<tr> 
			<td height="60px" width="210" align="left">
				<a href="/">
					<img src="<%=request.getContextPath() %>/images/logo.gif" height="28" border="0" />
				</a>
			</td> 
		</tr>
		<tr>
			<td align="right" valign="top">
			<s:if test="%{#session.SPRING_SECURITY_CONTEXT.authentication.principal != null}">
			 	<span style="">
			 		欢迎&nbsp;<font color="brown"><s:property value="%{#session.SPRING_SECURITY_CONTEXT.authentication.principal.nickName}"/></font>&nbsp;回来&nbsp;&nbsp;
			 		<a href="<%=request.getContextPath() %>/user/user!editSelfInfo.do">个人信息修改</a>&nbsp;&nbsp;
			 		<s:if test="%{#session.SPRING_SECURITY_CONTEXT.authentication.principal.familyId!=null && #session.SPRING_SECURITY_CONTEXT.authentication.principal.familyId != ''}">
			 			<a href="<%=request.getContextPath() %>/finance/family!show.do">家庭信息</a>&nbsp;&nbsp;
			 		</s:if>
					<a href="<%=request.getContextPath() %>/user/password.jsp">密码修改</a>&nbsp;&nbsp;
					<a href="<%=request.getContextPath() %>/j_spring_security_logout">退出</a>
			 	</span>
			</s:if>
			<s:else>
		    	<a href="<%=request.getContextPath() %>/login.jsp">登录</a><br />
		    	<div style="display: none;">
			    	<form method="post" id="loginForm" action="<%= request.getContextPath() %>/j_spring_security_check">
				    <table>
						<tr>
							<td>
					        <p>用户名：</p>
					        </td>
					        <td>
					        <p><input type="text" name="j_username" id="j_username" /></p>
					        </td>
				        </tr>
				        <tr>
				        	<td>
				        	<p>密码：</p>
				        	</td>
				        	<td>
				        	<p><input type="password" name="j_password" id="j_password" /></p>
				        	</td>
				        </tr>
				        <tr>
				        <td colspan="2">
				        	<p><input type="submit" value="登录" /></p>
				        </td>
				        </tr>
				        <% if("true".equals(request.getParameter("error"))){ %>
				        <tr><td colspan="2"><span style="color: red">用户名或密码错误</span></td></tr>
				        <% } %>
				    </table>
				    </form>
			    </div>
			</s:else>
			</td> 
		</tr>
		<s:if test="%{#session.SPRING_SECURITY_CONTEXT.authentication.principal != null}">
		<tr>
			<td>
				<div class="ui-corner-top nav">
					<ul id="menuUl">
						<li>
							<a href="<%= request.getContextPath() %>/index.jsp">
							<span>
								首页
							</span>
							</a>
						</li>
						<li>
							<a href="<%= request.getContextPath() %>/admin/refresh.jsp">
							<span>
								缓存刷新
							</span>
							</a>
						</li>
					</ul>
				</div>
			</td>
		</tr>
		</s:if>
	</table> 